#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll solve(ll a, ll b, ll x, ll y, ll n) {
  // 先使劲减小a，如果还剩下n就用来减小b
  ll dist = a - x;
  if (dist >= n) {
    a -= n;
  } else {
    a = x;
    n -= dist;
    ll dist2 = b - y;
    if (dist2 >= n) {
      b -= n;
    } else {
      b = y;
    }
  }
  return a * b;
}
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    ll a, b, x, y, n;
    cin >> a >> b >> x >> y >> n;
    cout << min(solve(a, b, x, y, n), solve(b, a, y, x, n)) << endl;
  }
}
